﻿import com.dinmax.isolution.*
import com.dinmax.flash.utilities.xml.*;
class CommunicationEventFactory {
	
	public static function getCommunicationEvent(doc:XML):Array {
		var node:XMLNode = XMLUtils.getNode(doc, "action");
		if( node != undefined){
			switch(XMLUtils.getAttribute(node, "name")){
				case "getArtifacts":
					return ParseXMLArtifact.parse(node);
				break;
				case "getThemes":
					return ParseXMLTheme.parse(node);
				break;
				case "getTheme":
					return ParseXMLTheme.parseTheme(node);
				break;
				case "changeArtifact":
					return ParseXMLArtifact.parseChange(node);
				break;
				case "changeTheme":
					return ParseXMLTheme.parseChange(node);
				break;
				case "access":
					return ParseXMLPerson.parse(node);
				break;
				
				default:
					throw new Error("CommunicationEventFactory.as | no reconozco la acción\n"+ XMLUtils.getAttribute(node, "name"));
				break;
				
			};
								
	}; // fin funci	
	
}; // fin de clase

	
}